<?php
/**
* Elgg bookmarks save action
*
* @package GolfScore
*/
$golf_course_card_id = get_input('golf_course_card_id');
$gold_tee_distance = get_input('gold_tee_distance');
$blue_tee_distance = get_input('blue_tee_distance');
$white_tee_distance = get_input('white_tee_distance');
$red_tee_distance = get_input('red_tee_distance');
$par = get_input('par');
$hole_x = get_input('hole_x');
$hole_y = get_input('hole_y');
$gold_tee_x = get_input('gold_tee_x');
$gold_tee_y = get_input('gold_tee_y');
$blue_tee_x = get_input('blue_tee_x');
$blue_tee_y = get_input('blue_tee_y');
$white_tee_x = get_input('white_tee_x');
$white_tee_y = get_input('white_tee_y');
$red_tee_x = get_input('red_tee_x');
$red_tee_y = get_input('red_tee_y');

$golf_course_card = new ElggGolfCourseCardItem();
$golf_course_card->golf_course_card_id = $golf_course_card_id;
$golf_course_card->gold_tee_distance = $gold_tee_distance;
$golf_course_card->blue_tee_distance = $blue_tee_distance;
$golf_course_card->white_tee_distance = $white_tee_distance;
$golf_course_card->red_tee_distance = $red_tee_distance;
$golf_course_card->par = $par;
$golf_course_card->hole_x = $hole_x;
$golf_course_card->hole_y = $hole_y;
$golf_course_card->gold_tee_x = $gold_tee_x;
$golf_course_card->gold_tee_y = $gold_tee_y;
$golf_course_card->blue_tee_x = $blue_tee_x;
$golf_course_card->blue_tee_y = $blue_tee_y;
$golf_course_card->white_tee_x = $white_tee_x;
$golf_course_card->white_tee_y = $white_tee_y;
$golf_course_card->red_tee_x = $red_tee_x;
$golf_course_card->red_tee_y = $red_tee_y;

save_golf_course_card($golf_course_card);

$error = array('error' => '0');
$error = json_encode($error);
print $error;